package ControlLayer;

import static org.junit.Assert.*;

import org.junit.Test;




/**
 * The test class PersonCtr_Test:
 * Contains test methods for the Person controller. 
 *
 * @author  (Gruppe 3)
 */
public class PersonCtr_Test
{
    /**
     * Default constructor for test class Person_Ctr_Test
     */
    public PersonCtr_Test()
    {
    }

    /**
     * Sets up the test fixture.
     *
     * Called before every test case method.
     */
    @Before
    public void setUp()
    {
    }

    /**
     * Tears down the test fixture.
     *
     * Called after every test case method.
     */
    @After
    public void tearDown()
    {
    }

    @Test
    public void TestAddCustomer()
    {
        ControlLayer.PersonCtr personCt2 = new ControlLayer.PersonCtr();
        personCt2.addCustomer("TestName", "TestAddress", "TestPhone", "TestMail", "TestID", 0, "TestCvr");
        assertNotNull(personCt2.getCustomer("TestID"));
    }

    @Test
    public void TestAddEmployee()
    {
        ControlLayer.PersonCtr personCt1 = new ControlLayer.PersonCtr();
        personCt1.addEmployee("TestName", "TestAddress", "TestPhone", "TestMail", "TestID");
        assertNotNull(personCt1.getEmployee("TestID"));
    }

    @Test
    public void TestDeleteCustomer()
    {
        ControlLayer.PersonCtr personCt1 = new ControlLayer.PersonCtr();
        personCt1.addCustomer("TestName", "TestAddress", "TestPhone", "TestMail", "TestID2", 0, "TestCvr");
        personCt1.deleteCustomer("TestID2");
        assertNull(personCt1.getCustomer("TestID2"));
    }

    @Test
    public void TestDeleteEmployee()
    {
        ControlLayer.PersonCtr personCt1 = new ControlLayer.PersonCtr();
        personCt1.addEmployee("TestName", "TestAddress", "TestPhone", "TestMail", "TestID2");
        personCt1.deleteEmployee("TestID2");
        assertNull(personCt1.getEmployee("TestID2"));
    }

    @Test
    public void TestGetCustomer()
    {
        ControlLayer.PersonCtr personCt1 = new ControlLayer.PersonCtr();
        personCt1.addCustomer("TestName", "TestAddress", "TestPhone", "TestMail", "TestID", 0, "TestCvr");
        assertNotNull(personCt1.getCustomer("TestID"));
    }

    @Test
    public void TestGetEmployee()
    {
        ControlLayer.PersonCtr personCt1 = new ControlLayer.PersonCtr();
        personCt1.addEmployee("TestName", "TestAddress", "TestPhone", "TestMail", "TestID");
        assertNotNull(personCt1.getEmployee("TestID"));
    }
}








